﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for WaterLevelLogGateWay
/// </summary>
public class WaterLevelLogGateWay
{
    private DBHelper _dbHelper;
    private string _table = "laks_waterlevellog";

    public WaterLevelLogGateWay()
    {
        _dbHelper = new DBHelper("ealdb1.eal.local", "EJL05_DB", "ejl05_usr", "Baz1nga5");
        _dbHelper.Connect();
    }

    public bool Add(int id, double waterIn, double waterOut, double level, DateTime date)
    {
        //_dbHelper.Open();
        //bool insert = _dbHelper.InsertRow(_table, "stationid, waterin, waterout, waterlevel, date", String.Format("'{0}','{1}','{2}','{3},'{4}'", id, waterIn, waterOut, level, date)); //default for waterout is 0
        //_dbHelper.Close();
        //return insert;
        return false;
    }

    public bool Edit(int id, DateTime date, double waterOut, double waterLevel)
    {
        //_dbHelper.Open();
        //bool update = _dbHelper.UpdateRow(_table, String.Format("WaterOut = '{0}', WaterLevel = {1}", waterOut, waterLevel),
        //    String.Format("stationId = '{0}' AND date = '{1}'", id, date));
        //_dbHelper.Close();
        //return update;
        return false;
    }

    public void Get()
    { }
}